package com.jackrain.nea.common;


import com.alibaba.dubbo.config.annotation.Reference;
import com.jackrain.nea.fc.cp.api.ChrusersWebQueryCmd;
import com.jackrain.nea.util.ApplicationContextHandle;
import com.jackrain.nea.util.ReferenceUtil;
import com.jackrain.nea.web.face.User;
import org.springframework.stereotype.Service;


@Service
public class QueryUserUtil {


    @Reference(version = "1.0", group = "cp")
    ChrusersWebQueryCmd chrusersWebQueryCmd;

    public User getUser(String userName) {

        Object o = ReferenceUtil.refer(ApplicationContextHandle.getApplicationContext(),
                "com.jackrain.nea.fc.cp.api.ChrusersWebQueryCmd",
                "cp", "1.0");
        User user = (User) ((ChrusersWebQueryCmd) o).getUser(userName);
        return user;

    }

}
